package com.example.stream.collect;

import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * @author: wyb
 * @date: 2021/11/2 13:28
 * @describe:
 * @vision 1.0
 */
public class Test1 {
    public static void main(String[] args) {
        Student s1 = new Student("aa", 10,1);
        Student s2 = new Student("bb", 20,2);
        Student s3 = new Student("cc", 10,3);
        List<Student> list = Arrays.asList(s1, s2, s3);
        Map<Integer, List<Student>> collect = list.stream().collect(Collectors.groupingBy(Student::getAge));
        list.stream().collect(Collectors.groupingBy(Student::getType, Collectors.groupingBy(Student::getAge)))
    }
}
